<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "{{%error_log}}".
 *
 * @property integer $id
 * @property string $type
 * @property string $md5
 * @property string $message
 * @property string $code
 * @property string $trace
 * @property string $url
 * @property string $create_time
 * @property string $update_time
 * @property string $file
 * @property integer $line
 * @property integer $col
 * @property integer $is_solve
 */
class ErrorLog extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%error_log}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['trace', 'create_time', 'update_time'], 'required'],
            [['trace'], 'string'],
            [['create_time', 'update_time'], 'safe'],
            [['line', 'col', 'is_solve'], 'integer'],
            [['type', 'code'], 'string', 'max' => 10],
            [['md5'], 'string', 'max' => 32],
            [['message', 'url', 'file'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'type' => '错误类型',
            'md5' => '信息和trace加密',
            'message' => '信息',
            'code' => '错误代码',
            'trace' => 'traceJSON信息',
            'url' => 'URL',
            'create_time' => '添加时间',
            'update_time' => '更新信息',
            'file' => '错误文件位置',
            'line' => '行数',
            'col' => '列数',
            'is_solve' => '是否解决',
        ];
    }
}
